<template>
	<view>
		<view class="appointment-list">
			<view class="item" v-for="(item,index) in appointmentList">
				<p>预约用户:{{item.userName}}</p>
				<p>预约车牌号:{{item.plateNo}}</p>
				<p>预约引擎号:{{item.engineNo}}</p>
				<p>检车地点:{{item.placeName}}</p>
			</view>
		</view>
		<BottomTabbar :items="tabbarItems"></BottomTabbar>
	</view>
</template>

<script>
	import {
		http
	} from "../../utils/request.js"
	import {
		items
	} from "./tabBatItems.js"
	export default {
		data() {
			return {
				appointmentList : [],
				tabbarItems: items
			}
		},
		onBackPress() {
			uni.switchTab({
				url: "../index/index"
			})
			return true
		},
		created() {
			// 获取预约列表
			http({
				url : "/prod-api/api/traffic/checkCar/apply/list"
			}).then((res) => {
				this.appointmentList = res.data.rows
			})
		},
		methods: {

		}
	}
</script>

<style scoped>
.appointment-list {
	display: flex;
	flex-direction: column;
	padding: 1rem;
}
.appointment-list > .item + .item {
	margin-top: 1rem;
}
.appointment-list > .item {
	display: flex;
	flex-direction: column;
	padding: 1rem;
	background-color: aliceblue;
	border-radius: 10px;
}
</style>
